<template>
  <div v-for="item in menu" :key="item.name">
    <el-sub-menu  :index="item.path?item.path:item.name" v-if="item.children.length!==0">
      <template #title>
        <el-icon><img  style="width:20px;" :src="item.icon"  alt=""/></el-icon>
<!--        <span v-if="!app.isCollapse">{{item.name}}</span>-->
        <span>{{item.name}}</span>
      </template>
      <Tree :menu="item.children"></Tree>
    </el-sub-menu>
    <el-menu-item v-else :index="item.path">
      <el-icon><img  style="width:20px;" :src="item.icon"  alt=""/></el-icon>{{item.name}}
    </el-menu-item>
  </div>
</template>

<script setup lang="ts">
//@ts-ignore
defineProps<{ menu:any }>()


</script>
